<%@Page Language = "C#" Debug="true"  ValidateRequest="false"%> 
<%@ import Namespace="System.Xml" %>
<script language="C#" runat="server"> 
    void Page_Load()
    {
        XmlDocument XmlDoc = new XmlDocument();
        XmlNode versionNode = XmlDoc.CreateXmlDeclaration("1.0", "ISO-8859-1", "yes");
        XmlNode mainNode = XmlDoc.CreateElement("books");
        XmlDoc.AppendChild(versionNode);
        XmlDoc.AppendChild(mainNode);

        foreach (string key in Request.QueryString)
        {
            XmlNode childNode = XmlDoc.CreateElement("book");
            XmlNode TitleNode = XmlDoc.CreateElement("title");
            TitleNode.AppendChild(XmlDoc.CreateTextNode(Request.QueryString[key]));            
            childNode.AppendChild(TitleNode);
            mainNode.AppendChild(childNode);
        }
        XmlDoc.Save(Server.MapPath("List.Xml"));
    }
</script>
